package my_practice;

public class ArrayCopyDemo
{
	public static void main(String[] args) 
	{
		char[] copyFrom = {'d','e','c','a','f','f',
				'e','i','n','a','t','e','d'};
		char[] copyTo=new char[7];
		
		System.arraycopy(copyFrom, 0, copyTo, 0, 7);
		
		
		//System.out.println(new String(copyTo));//等价于一下两行代码
		String s = new String(copyTo);
		System.out.println(s);
		
		System.arraycopy(copyFrom, 2, copyTo, 1, 6);
		System.out.println(copyTo);
	}

}
